package com.eeds.controller.pc;

import com.eeds.base.BaseController;
import com.eeds.common.model.BaseWrapper;
import com.eeds.interceptor.NeedAuth;
import com.eeds.model.index.res.ResGetWelcomeInfoVO;
import com.eeds.model.region.req.ReqGetRegionListVO;
import com.eeds.model.region.res.ResGetRegionListVO;
import com.eeds.service.region.RegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

@RestController
@Api(value = "区域接口", description = "区域接口")
@RequestMapping("pc/region/")
public class RegionController extends BaseController {

    @Autowired
    private RegionService regionService;

    /**
     * description:获取区域列表
     * @author: Flying
     * @date: 2018-08-28 12:31
     * @param: null
     * @return
     */
    @RequestMapping(value = "/getRegionList", method = RequestMethod.GET)
    @ApiOperation("获取区域列表")
    @NeedAuth
    public BaseWrapper<List<ResGetRegionListVO>> getRegionList(@Valid @ModelAttribute ReqGetRegionListVO reqGetRegionListVO){
        List<ResGetRegionListVO> result =
                regionService.getRegionList(reqGetRegionListVO);
        return new BaseWrapper<>(result);
    }
}
